            <style>
            	.div_goods_name{
            		float: left;
            	}
            	.g_search{
            		margin-left: 10px;
            		margin-bottom: 10px;
            	}
            	.g_item{
            		line-height: 30px;
            		float: left;
            		width: 100%;
            	}
            	.g_text{
            		font-weight: bold;
            		float: left;
            		width: 80px;
            		text-align: right;
            	}
            	.g_val{
            		float: left;
            		width: 400px;
            		word-break: break-all; word-wrap:break-word;
            	}
            	#is_have_good{
            		margin-left: 10px;
            		color: red;
            	}
            </style>
            <h5> <i class="fa fa-users"></i>&nbsp;&nbsp;物品查询</h5>
            <table class="table table-bordered">
            	<colgroup>
                    <col style="width: 20%;"></col>
                    <col style="width: 80%;"></col>
                </colgroup>
                <tr>
                    <th class="th-label">物品查询</th>
                    <td>
                    	<div class="g_search">
                    		<div class="div_goods_name"></div>
                    		<!--<input type="text" name="goods_name" id="goods_name" class="form-control inline" size="30" />&nbsp;&nbsp;-->
                            <a href="javascript:void(0)" name="start_search" class="btn btn-default">查询</a>
                    	</div>
                    	<div id="i_g_search" style="display: none;">
                    		<div class="g_item">
                    			<div class="g_text">物品ID：</div>
                    			<div class="g_val" id="g_val_id"></div>
                    		</div>
                    		<div class="g_item">
                    			<div class="g_text">物品名称：</div>
                    			<div class="g_val" id="g_val_name"></div>
                    		</div>
                    		<!--<div class="g_item">
                    			<div class="g_text">物品品质：</div>
                    			<div class="g_val">42423424</div>
                    		</div>
                    		<div class="g_item">
                    			<div class="g_text">物品阶数：</div>
                    			<div class="g_val">42423424</div>
                    		</div>
                    		<div class="g_item">
                    			<div class="g_text">物品星级：</div>
                    			<div class="g_val">42423424</div>
                    		</div>                           -->
                            <div class="g_item">
                        	    <div class="g_text">物品描述：</div>
                        	    <div class="g_val" id="g_val_desc"></div>
                            </div>
                    	</div>
                    	
                    	<div id="is_have_good" style="display: none;">
                    		不存在
                    	</div>
                        
                    </td>
                </tr>
            </table>
            
<script>
	$('a[name="start_search"]').click(function(){
		var goods_name = $('input[name="goods_name"]').val();
        if(goods_name == ''){
        	layer.alert('请填写物品名称', {icon: 2, skin: 'layui-layer-molv'});
            return false;
        }else{
        	var g = $('input[name="g"]').val();
	        var url = '?r=goods/getValue&g='+g;
	        $.ajax({
    	        type : 'POST',
    	        url : url,
		        data : {'val':goods_name,'type':1},
		        dataType :'JSON',
		        success : function(res){
			        if(res.status == 1){
			        	if(res.data.gid != ''){
			        		$("#g_val_id").text(res.data.gid);
			        	    $("#g_val_name").text(goods_name);
			        	    $("#g_val_desc").text(res.data.description);
			        	    $("#i_g_search").show();
			        	    $("#is_have_good").hide();
			        	}else{
			        		$("#i_g_search").hide();
			        		$("#is_have_good").show();
			        	}
			        	
			        }else{
					
			        }
		        }
	        });
        }
        
        
	});
	
$(document).ready(function(){
	$('.div_goods_name').autocomplete({
		placeholder: '物品名称',
		hints: proposals,
		width: 150,
		height: 34,
		showButton: false,
		name:'goods_name',
		search:search
	});
});
</script>